﻿using MiniFox.Resources;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace MiniFox.Exceptions
{
    /// <summary>
    /// 
    /// </summary>
    [Serializable]
    public class SystemException : Exception
    {
        internal const string ERROR_CODE = "9999";

        string _code;
        /// <summary>
        /// 
        /// </summary>
        public SystemException() : this(CommonMessages.MSG_SysError, ERROR_CODE)
        {
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="message"></param>
        public SystemException(string message) : this(message, ERROR_CODE)
        {
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="message"></param>
        /// <param name="code"></param>
        public SystemException(string message, string code) : base(message)
        {
            this._code = code;
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="innerException"></param>
        public SystemException(Exception innerException) : this(CommonMessages.MSG_SysError, ERROR_CODE, innerException)
        {
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="code"></param>
        /// <param name="innerException"></param>
        public SystemException(Exception innerException, string code) : this(CommonMessages.MSG_SysError, code, innerException)
        {
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="message"></param>
        /// <param name="innerException"></param>
        public SystemException(string message, Exception innerException) : this(message, ERROR_CODE, innerException)
        {
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="message"></param>
        /// <param name="code"></param>
        /// <param name="innerException"></param>
        public SystemException(string message, string code, Exception innerException) : base(message, innerException)
        {
            this._code = code;
        }
        /// <summary>
        /// 
        /// </summary>
        public virtual string ErrorCode
        {
            get
            {
                return _code;
            }
        }
    }
}
